package com.atguigu.newmvc2.validate;

import com.atguigu.newmvc2.annotation.Gender;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import org.springframework.validation.annotation.Validated;

import java.lang.annotation.Annotation;

public class GenderValidate implements ConstraintValidator<Gender,String > {

    @Override
    public boolean isValid(String s, ConstraintValidatorContext constraintValidatorContext) {
       return s.equals("男") || s.equals("女");
    }
}
